-
-
Notifications
You must be signed in to change notification settings - Fork 65
Add window behavior modifiers #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add window behavior modifiers #313
Conversation
…o:)` into `setBehaviors(ofWindow:closable:minimizable:)`
… add `windowResizeBehavior(_:)` with the old behavior
…)` into `setSizeLimits(ofWindow:minimum:maximum:)`
|
It seems like |
|
We could do that, yeah. |
stackotter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend API changes that you've made are well designed. I've just got some requested changes related to parts of the backend implementations and documentation.
7a43fd7 to
abeef16
Compare
|
This one has merge conflicts now (I'll review once they're fixed to avoid reviewing twice) |
|
Tested with all supported backends and works as documented |
stackotter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing those things. Going to merge now
This PR adds view modifiers for controlling properties of the attached view's enclosing window. Currently, this includes:
windowDismissBehavior(_:)dismissWindowwhen that's merged inpreferredWindowMinimizeBehavior(_:)windowResizeBehavior(_:)windowResizability(_:)did before this PR.automaticand.enabledbehave like.contentMinSize,.disabledbehaves like.contentSizeThey're view modifiers rather than scene modifiers because that's what SwiftUI does.
In addition,
windowResizability(_:)has been updated to match SwiftUI's behavior (which resolves #263)..contentMinSizelimits the window's minimum size but not its maximum size, while.contentSizelimits the minimum and maximum sizes. (An extracomputeLayoutcall is made to the view graph to compute the maximum size, but only when it's actually needed.) Maximum size limits are: